3 LED pin can be used to emulate 5key OSD joystick for OSD camera pin, while still driving ws2812 LEDs (shared functionality).
5 See [LED pin PWM](LED%20pin%20PWM.md) for more details.
7 Note that for cameras which support RuncamDevice protocol, there is alternative functionality using serial communication: [Runcam device](Runcam%20device.md)
9 Also special adapters exist to convert RuncamDevice protocol to OSD Joystick: [Runcam control adapter](https://www.runcam.com/download/runcam_control_adapter_manual.pdf)
11 # OSD Joystick schematics
13 ![alt text](/docs/assets/images/osd_joystick_keys.png "osd jystick keys")
15 Camera internal resistance seems to be 47kOhm or 9kOhm depending on camera model.
17 Each key effectively turns on voltage divider. Voltage is sensed by the camera and is compared to the list of keys voltages with some threshold.
19 Key voltage has to be held for at least 200ms.
21 To simulate 5key joystick, it is sufficient to generate correct voltage on camera OSD pin.
23 # Enabling OSD Joystick emulation
25 ```set led_pin_pwm_mode=shared_high```
27 ```set osd_joystick_enabled=on```
29 Also enable "Multi-color RGB LED Strip support" in Configuration tab.
33 We use LED pin PWM functionality with RC filter to generate voltage:
35 ![alt text](/docs/assets/images/ledpinpwmfilter.png "led pin pwm filter")
37 # Example PCB layout (SMD components)
39 RC Filter can be soldered on a small piece of PCB:
41 ![alt text](/docs/assets/images/osd_joystick.jpg "osd joystick")
43 # Configuring keys voltages
45 If default voltages does not work with your camera model, then you have to measure voltages and find out corresponding PWM duty ratios.
47 1. Connect 5keys joystick to camera.
48 2. Measure voltages on OSD pin while each key is pressed.
49 3. Connect camera to FC throught RC filter as shown on schematix above.
50 4. Enable OSD Joystick emulation (see "Enabling OSD Joystick emulation" above)
51 4. Use cli command ```led_pin_pwm <value>```, value = 0...100 to find out PWM values for each voltage.
52 5. Specify PWM values in configuration and save:
54 ```set osd_joystick_down=0```
56 ```set osd_joystick_up=48```
58 ```set osd_joystick_left=63```
60 ```set osd_joystick_right=28```
62 ```set osd_joystick_enter=75```
66 # Entering OSD Joystick emulation mode
68 Emulation can be enabled in unarmed state only.
70 OSD Joystick emulation mode is enabled using the following stick combination:
72 ```Throttle:CENTER Yaw:RIGHT```
75 Than camera OSD can be navigated using right stick. See [Controls](Controls.md) for all stick combinations.
77 *Note that the same stick combination is used to enable 5keys joystick emulation with RuncamDevice protocol.*
79 Mode is exited using stick combination:
81 ```Throttle:CENTER Yaw:LEFT```
85 There are 3 RC Boxes which can be used in armed and unarmed state:
90 Other keys can be emulated using Programming framework ( see [LED pin PWM](LED%20pin%20PWM.md) for more details ).
94 There is ~2 seconds LOW pulse during boot sequence, which corresponds to DOWN key. Fortunately, cameras seem to ignore any key events few seconds after statup.